package com.hckj.medical.controller;


import com.hckj.medical.entity.Middle;
import com.hckj.medical.service.IMiddleService;
import com.hckj.medical.utils.Code;
import com.hckj.medical.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hckj
 * @since 2023-11-25
 */
@RestController
@RequestMapping("/medical/middle")
public class MiddleController {
    @Autowired
    private IMiddleService iMiddleService;
    @PostMapping("/insertMiddle")
    public R insertMiddle(@RequestBody Middle middle){
        Integer integer = iMiddleService.insertMiddle(middle);
        if (integer>0){
            return new R(Code.SAVE_OK,"添加成功");
        }else {
            return new R(Code.SAVE_ERRO,"添加失败");
        }
    }
}
